package pub.wkq.auth.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pub.wkq.api.retry.RetryComponent;
import pub.wkq.api.task.SMSTask;

import javax.annotation.Resource;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;

@RestController
@RequestMapping("auth")
@Slf4j
public class AuthController {
    @Resource
    private SMSTask smsTask;
    @GetMapping("test")
    public String test() throws ExecutionException, InterruptedException {
        Future<Boolean> booleanFuture = smsTask.sendSms("12345678901", "123456");
        log.info("auth-service test");
        log.info("booleanFuture = {}", booleanFuture.get());
        return "auth-service test";
    }
}
